@(calendarMonthOffset: Int = 0, newsBlock : Int)

@import models.NewsDescriptor
@import models.NewsUtils
@import models.NewsBlock
@import views.utils.CalendarInfo
@import views.utils.CalendarInfoNews
@import views.utils.NewsHrefUtils

@main("Новости", "news.css", new CalendarInfoNews("/news", calendarMonthOffset, newsBlock)) {
     	@for(news <- NewsUtils.nthNews(newsBlock)){
     		<div class="full_date">
     			<div class="date">
     				@news.getDate
     			</div> 
     			<div class="time">
     				@news.getTime
				</div>
     		</div>
     		<div class="news_body">
     			@news.getBody
     		</div>
     	}
        <div id="news_pages_switch">
            @if(newsBlock > NewsBlock.BLOCKS_PER_PAGE){
            	<a href=@NewsHrefUtils.buildHref(calendarMonthOffset, 1)>1 </a>
            	<a id="news_page_back" href=@NewsHrefUtils.buildHrefForPrevChunk(calendarMonthOffset, newsBlock)>
        			...
        		</a>
            }
            @for(i <- NewsBlock.getChunkBeg(newsBlock) to NewsBlock.getChunkEnd(newsBlock, NewsUtils.numberOfBlocks)){
        		<a href=@NewsHrefUtils.buildHref(calendarMonthOffset, i)>
        			@i 
        		</a>
        	}
        	@if(newsBlock < NewsBlock.getChunkBeg(NewsUtils.numberOfBlocks)){
        		<a id="news_page_next" href=@NewsHrefUtils.buildHrefForNextChunk(calendarMonthOffset, newsBlock, NewsUtils.numberOfBlocks)>
        			...
        		</a>
        		<a href=@NewsHrefUtils.buildHref(calendarMonthOffset, NewsUtils.numberOfBlocks)>@NewsUtils.numberOfBlocks</a>
        	}
        </div>
} 